import { IFeidaoAiBrowserComponent } from '@feidao/web/interfaces';
import Carousel from '@feidao/widgets/fd-wh000000';

export default async function a002(fd: IFeidaoAiBrowserComponent, ...args: any[]) {
	const v = fd.data.node.querySelector<HTMLInputElement>('[name="data-value"]').value;
	if (!v) {
		alert('请输入轮播图数据');
	} else {
		const carousel = fd.data.node.querySelector<Carousel>('#fd-wh000000-001');
		carousel.setAttribute('value', v);
	}

	fd.data.node.querySelector<HTMLAreaElement>('[data-feidao-id="fd-wh000000-003"]').innerHTML = `
const v = fd.data.node.querySelector<HTMLInputElement>('[name="data-value"]').value;
if (!v) {
	alert('请输入轮播图数据');
} else {
	const carousel = fd.data.node.querySelector<Carousel>('#fd-wh000000-001');
	carousel.setAttribute('value', v);
}
	`;
}
